package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiT_order;

//DAO
public interface T_orderMapperBase {

	// 根据id查看
	@Select("SELECT * FROM T_ORDER  WHERE rid = #{rid}")
	public ApiT_order findT_orderById(Integer rid);

	// 根据id查看
	@Select("SELECT * FROM T_ORDER  WHERE orderNum = #{orderNum}")
	public ApiT_order findT_orderByOrderNum(String orderNum);

	// 查看数据集
	@Select("SELECT * FROM T_order")
	public List<ApiT_order> findT_orders();

	// 根据条件查看数据集
	public List<Map<String, Object>> findT_ordersByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO T_ORDER (TITLES, SHOP_ID, USER_ID, PEISONG, NAME, TEL, MOBILE, EMAIL, ZIP, ADDRESS, DTIME, BZ, MONEY, APPUSER, APPDATE, RIP, ENABLE, ZI_STATUS, DD_STATUS, ZF_TYPE, REMAINMONEY, SERIAL, SERIALFLAGNO, ORDERTYPE, PAYTIME, SUMGOODSPRICE, SENDFEE, TAKEGOODSTIME, CANCELREASON, PRODUCT_IDS, CAR_IDS, IS_QUAN, QUAN_ID, PAYMONEY, SENDDATE, LONGITUDE, LATITUDE, TO_SHOP_DISTENCE, TO_USER_DISTENCE, IS_SEND, SUMPOINTS, ORDERNUM, IS_LUNCHBOX, LUNCHBOX_PRICE, SUM_LUNCHBOX_PRICE, GOODSCOUNT, IS_PRINT, CANCLE_TIME, PRINT_TIME, OVERTIME_DUTY, WXPAYSTR, EXT_1, EXT_2, EXT_3, EXT_4, EXT_5, remind_shipment) VALUES (#{titles}, #{shop_id}, #{user_id}, #{peisong}, #{name}, #{tel}, #{mobile}, #{email}, #{zip}, #{address}, #{dtime}, #{bz}, #{money}, #{appuser}, #{appdate}, #{rip}, #{enable}, #{zi_status}, #{dd_status}, #{zf_type}, #{remainmoney}, #{serial}, #{serialflagno}, #{ordertype}, #{paytime}, #{sumgoodsprice}, #{sendfee}, #{takegoodstime}, #{cancelreason}, #{product_ids}, #{car_ids}, #{is_quan}, #{quan_id}, #{paymoney}, #{senddate}, #{longitude}, #{latitude}, #{to_shop_distence}, #{to_user_distence}, #{is_send}, #{sumpoints}, #{ordernum}, #{is_lunchbox}, #{lunchbox_price}, #{sum_lunchbox_price}, #{goodscount}, #{is_print}, #{cancle_time}, #{print_time}, #{overtime_duty}, #{wxpaystr}, #{ext_1}, #{ext_2}, #{ext_3}, #{ext_4}, #{ext_5}, #{remind_shipment})")
	@Options(useGeneratedKeys = true, keyProperty = "rid")
	public int insertT_order(ApiT_order t_order);

	// 修改
	@Update("UPDATE T_ORDER SET TITLES = #{titles}, SHOP_ID = #{shop_id}, USER_ID = #{user_id}, PEISONG = #{peisong}, NAME = #{name}, TEL = #{tel}, MOBILE = #{mobile}, EMAIL = #{email}, ZIP = #{zip}, ADDRESS = #{address}, DTIME = #{dtime}, BZ = #{bz}, MONEY = #{money}, APPUSER = #{appuser}, APPDATE = #{appdate}, RIP = #{rip}, ENABLE = #{enable}, ZI_STATUS = #{zi_status}, DD_STATUS = #{dd_status}, ZF_TYPE = #{zf_type}, REMAINMONEY = #{remainmoney}, SERIAL = #{serial}, SERIALFLAGNO = #{serialflagno}, ORDERTYPE = #{ordertype}, PAYTIME = #{paytime}, SUMGOODSPRICE = #{sumgoodsprice}, SENDFEE = #{sendfee}, TAKEGOODSTIME = #{takegoodstime}, CANCELREASON = #{cancelreason}, PRODUCT_IDS = #{product_ids}, CAR_IDS = #{car_ids}, IS_QUAN = #{is_quan}, QUAN_ID = #{quan_id}, PAYMONEY = #{paymoney}, SENDDATE = #{senddate}, LONGITUDE = #{longitude}, LATITUDE = #{latitude}, TO_SHOP_DISTENCE = #{to_shop_distence}, TO_USER_DISTENCE = #{to_user_distence}, IS_SEND = #{is_send}, SUMPOINTS = #{sumpoints}, ORDERNUM = #{ordernum}, IS_LUNCHBOX = #{is_lunchbox}, LUNCHBOX_PRICE = #{lunchbox_price}, SUM_LUNCHBOX_PRICE = #{sum_lunchbox_price}, GOODSCOUNT = #{goodscount}, IS_PRINT = #{is_print}, CANCLE_TIME = #{cancle_time}, PRINT_TIME = #{print_time}, OVERTIME_DUTY = #{overtime_duty}, WXPAYSTR = #{wxpaystr}, EXT_1 = #{ext_1}, EXT_2 = #{ext_2}, EXT_3 = #{ext_3}, EXT_4 = #{ext_4}, EXT_5 = #{ext_5}, remind_shipment = #{remind_shipment} WHERE RID = #{rid}")
	public int updateT_order(ApiT_order t_order);

	// 删除
	@Delete("DELETE FROM T_ORDER  WHERE RID = #{rid}")
	public int deleteT_order(Integer rid);

	// Foreign keys revelant

	// region Indexs revelant

}
